 //this的使用
  class Shop {
    String name;
    double price;
    int total;
    public Shop(String name,double price,int total) {
        this.name  = name;
        this.price = price;
        this.total = total;
        System.out.println("名称: "+name+" 价格: "+price+" 总数: "+total);
    }
  }
   public class Practice {
    public static void main(String[] args) {
     Shop shop = new Shop("铅笔",3,10);
     Shop shop1 = new Shop("橡皮",2,20);
     Shop shop2 = new Shop("尺子",1,10);
     Shop shop3 = new Shop("钢笔",5,10);
    }
}
//创建一个类，并实体化
/*
class Student {
    String name; //姓名
    String sex; //性别
    int age; //年龄

    public void printf() {
        System.out.println("姓名:" + name + " 年龄:" + age + " 性别:" + sex);
    }
}
    public class Practice {

        public static void main(String[] args) {
            Student student = new Student();
            student.name = "张三";
            student.age = 23;
            student.sex = "男";
            student.printf();
            student.name = "王姐";
            student.age = 21;
            student.sex = "女";
            student.printf();
        }
    }
*/
